#include <iostream>
#include <vector>
using namespace std;
using ll=long long;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n,a,b;
		cin>>n>>a>>b;
		ll sum=0;
		if(n<=2)
		{
			sum=min(a,b);
		}
		else if(3*a<2*b)
		{
			sum+=n/2*a;
			n%=2;
			if(n==1)
			{
				sum+=min(a,b-a);
			}
		}
		else{
			sum+=n/3*b;
			n%=3;
			if(n==1)
			{
				sum+=min(a,min(b,2*a-b));
			}
			else if(n==2)
			{
				sum+=min(a,min(b,3*a-b));
			}
		}
		cout<<sum<<endl;
	}
	return 0;
}
